/*
 * Copyright 2013 Agustina Martinez-Garcia

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package uk.ljmu.fedoraifz.restrequests;

public interface FedoraOperationsAPIM {
    /**
     * 
     * @return
     */
    public String getNextPID();

    /**
     * 
     * @param numpids
     * @param ns
     * @param format
     * @return
     */
    public String getNextPID(int numpids, String ns, String format);

    /**
     * 
     * @param pid
     * @param dsName
     * @param contents
     * @param mimetype
     * @return
     */
    public String addDatastream(String pid, String dsName, String contents,
	    String mimetype);

    /**
     * 
     * @param pid
     * @param dsName
     * @param controlgroup
     * @param dslocation
     * @param altids
     * @param dslabel
     * @param versionable
     * @param dsstate
     * @param formaturi
     * @param checksumtype
     * @param checksum
     * @param mimetype
     * @param logmessage
     * @return
     */
    public String addDatastream(String pid, String dsName, String controlgroup,
	    String dslocation, String altids, String dslabel,
	    String versionable, String dsstate, String formaturi,
	    String checksumtype, String checksum, String mimetype,
	    String logmessage);

    /**
     * 
     * @param pid
     * @param dsname
     * @return
     */
    public String getDatastream(String pid, String dsname, String asofdatetime, String format, boolean validatechecksum);

    /**
     * 
     * @param pid
     * @param format
     * @param asOfDateTime
     * @return
     */
    public String getDatastreams(String pid, String format, String asOfDateTime);

    /**
     * 
     * @param pid
     * @param dsId
     * @param format
     * @param asOfDateTime
     * @param validateChecksum
     * @return
     */
    public String getDatastream(String pid, String dsId, String format,
	    String asOfDateTime, String validateChecksum);

    /**
     * 
     * @param pid
     * @param dsId
     * @return
     */
    public String getDatastreamContent(String pid, String dsId);

    /**
     * 
     * @param pid
     * @param dsid
     * @param dslocation
     * @param altids
     * @param dslabel
     * @param versionable
     * @param dsstate
     * @param formaturi
     * @param checksumtype
     * @param checksum
     * @param mimetype
     * @param logmessage
     * @param ignorecontent
     * @param lastmodifieddate
     * @return
     */
    public String modifyDatastream(String pid, String dsid, String dslocation,
	    String altids, String dslabel, Boolean versionable, String dsstate,
	    String formaturi, String checksumtype, String checksum,
	    String mimetype, String logmessage, Boolean ignorecontent,
	    String lastmodifieddate);

    /**
     * @param pid
     * @return
     */
    public String createObject(String pid);

    /**
     * 
     * @return
     */
    public String createObject();

    /**
     * 
     * @param pid
     * @param contents
     * @param mimetype
     * @param label
     * @param logmessage
     * @param format
     * @param encoding
     * @param namespace
     * @param ownerid
     * @param state
     * @param ignoremime
     * @return
     */
    public String createObject(String pid, String contents, String mimetype,
	    String label, String logmessage, String format, String encoding,
	    String namespace, String ownerid, String state, String ignoremime);

    /**
     * 
     * @param pidname
     * @return
     */
    public String deleteObject(String pidname);

    /**
     * 
     * @param pidname
     * @param dsname
     * @return
     */
    public String deleteDatastream(String pidname, String dsname);

    /**
     * 
     * @param pidname
     * @param dsname
     * @param startdt
     * @param enddt
     * @param logmessage
     * @param force
     * @return
     */
    public String deleteDatastream(String pidname, String dsname,
	    String startdt, String enddt, String logmessage, String force);

    /**
     * 
     * @param pid
     * @return
     */
    public String getObjectXML(String pid);

    /**
     * 
     * @param pid
     * @param ownerId
     * @param state
     * @param logMessage
     * @param lastmodifieddate
     * @param contents
     * @param mimetype
     * @return results
     */
    public String modifyObject(String pid, String label, String ownerId,
	    String state, String logMessage, String lastmodifieddate,
	    String contents, String mimetype);

    /**
     * 
     * @param pid
     * @param dsname
     * @param format
     * @param asOfDateTime
     * @param validateChecksum
     * @return
     */
    public String getDatastreamControlGroup(String pid, String dsname,
	    String format, String asOfDateTime, String validateChecksum);

    /**
     * 
     * @return
     */
    public String validate(String pid, String asofdatetime);

    /**
     * 
     * @param pid
     * @return
     */
    public String addRelationship(String pid);

    /**
     * 
     * @param pid
     * @param subject
     * @param predicate
     * @param object
     * @param isliteral
     * @param datatype
     * @return
     */
    public String addRelationship(String pid, String subject, String predicate,
	    String object, String isliteral, String datatype);

    /**
     * 
     * @param pid
     * @return
     */
    public String getRelationships(String pid);

    /**
     * 
     * @param pid
     * @param subject
     * @param predicate
     * @param object
     * @param format
     * @return
     */
    public String getRelationships(String pid, String subject,
	    String predicate, String object, String format);

    /**
     * 
     * @param pid
     * @return
     */
    public String purgeRelationship(String pid);

    /**
     * 
     * @param pid
     * @param subject
     * @param predicate
     * @param object
     * @param isliteral
     * @param datatype
     * @return
     */
    public String purgeRelationship(String pid, String subject,
	    String predicate, String object, String isliteral, String datatype);

    /**
     * 
     */
    public void closeHttpConnections();

    /**
     * Set the username and password used to access the repository
     * 
     * @param user
     *            fedora username
     * @param password
     *            password for fedora user
     */
    public void setCredentials(String user, String password);

    public String getFedoraUser();
}
